package com.briup.jz.web.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.briup.jz.bean.BaseUser;
import com.briup.jz.utils.Message;
import com.briup.jz.utils.MessageUtil;

import io.swagger.annotations.Api;



@Api(description = "用户控制器")
@Validated
@RestController
@RequestMapping("/user")
public class UserController {
	// 这里是假登录
	@PostMapping("login")


	public Message login(String username, String password) {
		Map<String, String> map = new HashMap<>();
		map.put("token", "admin");
		return MessageUtil.success(map);
	}

	
	// 这里是假获取用户信息
	

@GetMapping("info")
	public Message info(String token) {
		BaseUser user = new BaseUser();
		user.setRealname("点点");
		user.setUserFace(
				"https://tvax4.sinaimg.cn/crop.0.0.664.664.1024/c3696d88ly8gaagqpdl1kj20ig0igjrw.jpg?KID=imgbed,tva&Expires=1623047197&ssig=vSTKJ7gcpE");
		return MessageUtil.success(user);
	}
}
